package com.jml.单例模式;

public class 懒汉式解决并发问题 {
    private static 懒汉式解决并发问题 INSTANCE;

    private 懒汉式解决并发问题(){
        //可以避免反射破坏
        if(INSTANCE!=null){
            throw new RuntimeException("");
        }
    }

    public static synchronized 懒汉式解决并发问题 getInstance(){
        if(INSTANCE == null){
            INSTANCE = new 懒汉式解决并发问题();
        }
        return INSTANCE;
    }
}
